[% setvar title Perl 6 Summary for the week ending 20030817 %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='Perl 6 Summary for the week ending 20030817'></a><h1>Perl 6 Summary for the week ending 20030817</h1>
<p>Picture, if you will a sunny garden, unaffected by power cuts, floods,
plagues of frog or any of the other troubles that assail us in this
modern world. Picture, if you will, your summarizer, sat in this
garden with a laptop on his knee, cursing the inability of LCD
display manufacturers to make displays that are legible in
sunlight. Picture your summarizer returning to the comfortable chair
in the shade of his book room casting around for a witty and original
way to open another Perl 6 summary. Picture him giving up and
starting to type. Here's what he writes:</p>
<p>We start, as usual, with the the internals list.</p>
<a name='Tail call optimization'></a><h2>Tail call optimization</h2>
<p>Leo T&ouml;tsch has started to work on getting IMCC to detect tail
calls and optimize them to either a simple jump or an invoke. If
you're not sure what tail call optimization is I can recommend Dan's
&quot;What the heck is a tail call?&quot; article on the subject.</p>
<p><a href='http://groups.google.com/groups?threadm=200308110927.h7B9RCe00848@thu8.leo.home' target='_blank'>groups.google.com</a></p>
<p><a href='http://www.sidhe.org/~dan/blog/archives/000211.html' target='_blank'>www.sidhe.org</a> -- What the heck?</p>
<a name='Leo's QUERIES from last week'></a><h2>Leo's QUERIES from last week</h2>
<p>Last week, Leo bundled up a bunch of outstanding questions for Dan,
and Dan answered them. Benjamin Goldberg queried Dan's answer about
<code>find_method</code>, which, if I'm reading things correctly is currently
implemented in the interpreter. Benjamin argued (convincingly I
thought) that, although the method hashes needed to be stored in the
interpreter structure, <code>find_method</code> should be implemented on
<code>default.pmc</code>, allowing for different classes/languages to override
its behaviour.</p>
<p><a href='http://groups.google.com/groups?threadm=3F36E05F.75A27AF0@hotpop.com' target='_blank'>groups.google.com</a></p>
<a name='Why ~ for xor?'></a><h2>Why <code>~</code> for xor?</h2>
<p>Michal Wallace wanted to know why <code>~</code> maps to both unary bitwise-not
and binary bitwise-xor in IMCC; he expected xor to be <code>^</code> and
<code>^^</code>. Leo explained that it was, at one point at least, the way Perl
6 did it but that he'd stopped keeping up with the developments in
perl6-language. He noted that, if the Perl 6 operator had been
settled, then IMCC should use that. A quick skim of my copy of <i>Perl
6 Essentials</i> tells me that Perl 6 now uses <code>+&amp;</code>, <code>+|</code> and <code>+^</code>
for bitwise and/or/xor, with <code>~&amp;</code>, <code>~|</code>, <code>~^</code> for stringwise
and/or/xor.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308102333530.17955-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<p><a href='http://www.bofh.org.uk/archives/000011.html' target='_blank'>www.bofh.org.uk</a> -- My
review of <i>Perl 6 Essentials</i></p>
<a name='Raising Hell'></a><h2>Raising Hell</h2>
<p>Michal Wallace's Py-Pirate project continues to exercise the edges of
Parrot as he implements more and more of Python's semantics. This
time he needed to know about raising (and catching) exceptions. In
particular he wanted to be able to catch an exception when
<code>find_lex</code> failed to find an appropriately named
variable. (Currently, a <code>find_lex</code> failure doesn't raise an
exception, it just kills Parrot). Jos Visser told him that there were
plans to have <code>find_lex</code> throw a real, catchable exception, or maybe
just return <code>undef</code>. See last week's summary for a pointer to that
discussion.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308110323070.23278-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='Pirate status and help with instances'></a><h2>Pirate status and help with instances</h2>
<p>Michal Wallace announced that he had just finished an all night
coding spree and that Py-pirate could now handle:</p>
<ul>
<li><a name='functions (closures, recursion, etc)'></a>functions (closures, recursion, etc)</li>
<li><a name='Global variables'></a>Global variables</li>
<li><a name='tuples (but they turn into lists)'></a>tuples (but they turn into lists)</li>
<li><a name='dictionaries (create, setitem, getitem, print)'></a>dictionaries (<code>create</code>, <code>setitem</code>, <code>getitem</code>, <code>print</code>)</li>
<li><a name='list comprehensions'></a>list comprehensions</li>
<li><a name='raise (strings only)'></a><code>raise</code> (strings only)</li>
<li><a name='try...except (partial)'></a><code>try...except</code> (partial)</li>
<li><a name='try...finally'></a><code>try...finally</code></li>
<li><a name='assert'></a><code>assert</code></li>
</ul>
<p>(At this point, I think we should all pause for moment of wild
applause).</p>
<p>However, he was having a few problems with instantiating objects of a
class. (For those who don't know, Python instances are created by
calling the Class as if it were a function). Leo T&ouml;tsch noted
that almost nothing would work, since Parrot's classes and objects
weren't actually finished yet. He agreed with others in the thread
who reckoned that Python classes could be made to work by subclassing
the standard class.pmc to allow it to respond to an <code>invoke</code> by
by creating a new instance. Easy! Michal muttered something about
faking classes with closures but I don't think he went through with it.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308110526330.29940-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='Packfile fun'></a><h2>Packfile fun</h2>
<p>So long <b><i>assemble.pl</i></b>, it's been good to know you.</p>
<p><a href='http://groups.google.com/groups?threadm=m2he4o9v8b.fsf@helium.physik.uni-kl.de' target='_blank'>groups.google.com</a></p>
<a name='Approaching m4'></a><h2>Approaching m4</h2>
<p>Leon Brocard, Sean O'Rourke and James Michael DuPont looked on in awe
as Bernhard Schmalhofer announced that he'd been working on
implementing m4 in Parrot. According to Sean, the &quot;implications are
staggering... Sure, plenty of compilers can bootstrap themselves, but
how many can generate their own configure scripts via autoconf?  With
p4rrot, we may live to see this dream.&quot;</p>
<p>One does worry about Sean's dream life.</p>
<p><a href='http://groups.google.com/groups?threadm=3F392C26.30500@biomax.de' target='_blank'>groups.google.com</a></p>
<a name='Call and return conventions'></a><h2>Call and return conventions</h2>
<p>TOGoS has been thinking about the workings of the Parrot calling
conventions. He wondered if there was a case for making calling and
returning look exactly the same, allowing for cunning stunts with fake
continuations in P1. Luke Palmer really liked the idea. Leo seemed to
think it was a good idea too. There has been no word from Dan yet.</p>
<p><a href='http://groups.google.com/groups?threadm=20030813044321.55419.qmail@web41406.mail.yahoo.com' target='_blank'>groups.google.com</a></p>
<a name='Packfile and EXEC'></a><h2>Packfile and EXEC</h2>
<p>Leo T&ouml;tsch has started to extend the <code>packfile</code> functions to
handle multiple code segments and has been running into problems with
EXEC -- the tool that uses the JIT to generate a native executable from
Parrot assembly. Daniel Grunblatt checked in a 'temporary' fix, which
at least solved Leo's immediate problem.</p>
<p><a href='http://groups.google.com/groups?threadm=3F39F1AC.5000303@nextra.at' target='_blank'>groups.google.com</a></p>
<a name='Parrot 0.1.0 -- what's left?'></a><h2>Parrot 0.1.0 -- what's left?</h2>
<p>Steve Fink thought, given the 'insane amount of work' on Parrot
recently, that it was approaching time to cut another release. He
asked if there was anything else coming up that people would like to
see included in the release, and whether we had enough to call the
next release 0.1.0. Luke Palmer really wanted to see objects finished,
but wasn't sure how much would that would entail. Leo thought that the
Parrot Calling Conventions (and more particularly the return
convention) support needed fixing, and noted that PackFile is
currently in a state of flux. Both of them thought 0.1.0 would be the
right version number though.</p>
<p><a href='http://groups.google.com/groups?threadm=20030813214453.GA8382@foxglove' target='_blank'>groups.google.com</a></p>
<a name='set vs. assign continues to add vs add!'></a><h2><code>set</code> vs. <code>assign</code> continues to <code>add</code> vs <code>add!</code></h2>
<p>TOGoS wasn't keen on the variable behaviour of add depending on
whether its target was a PMC, or an integer/number register. Brent
Dax thought that TOGoS needed to train his expectations and went on
to explain why.</p>
<p>For reasons that I can't quite follow, this discussion morphed into a
polite argument between Dan and Leo about the wisdom of having all
those keyed opcodes.</p>
<p>Benjamin Goldberg pointed out that, since TOGoS's desired 'set'
semantics could easily mocked up with an assign operator (but not vice
versa), then maybe IMCC could handle mocking it up automatically.</p>
<p><a href='http://groups.google.com/groups?threadm=20030814033056.87966.qmail@web41415.mail.yahoo.com' target='_blank'>groups.google.com</a></p>
<a name='Serializing functions'></a><h2>Serializing functions</h2>
<p>Michal Wallace wondered if it is possible to serialize a Parrot
function, or (slightly more tricky) if you could serialize a
generator and its state. Answer: Yes, it's almost done (well, the
function part anyway; Leo didn't' mention the generator thing).</p>
<p>I'm not sure if the support for this was fixed up in the packfile
changes that Leo checked in a couple of hours after his answer.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308132149500.14468-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='Parrot and STDOUT/STDERR'></a><h2>Parrot and STDOUT/STDERR</h2>
<p>Arthur Bergman popped over from ponie-dev to ask about a problem he'd
been having with his parrot embedded miniperl. Apparently, if a
caller closes STDERR, the program produces no output on STDOUT
either. Leo found where the problem was happening -- Parrot was
trying to open STDERR, failing, and dying with an error message. To
STDERR. J&uuml;rgen B&ouml;mmels, the ParrotIO maintainer, outlined
a few possible fixes.</p>
<p><a href='http://groups.google.com/groups?threadm=5737C100-CE7C-11D7-8EC1-000A95A2734C@nanisky.com' target='_blank'>groups.google.com</a></p>
<a name='Calling Parrot from C'></a><h2>Calling Parrot from C</h2>
<p>Luke Palmer asked about calling a parrot sub from C and getting the
return value. Leo gave a terse answer that covered the bases and
pointed at <b><i>classes/Eval.pmc</i></b> for an implementation of something
very like the general case of calling parrot subs from C.</p>
<p><a href='http://groups.google.com/groups?threadm=20030815223815.GA25115@babylonia.flatirons.org' target='_blank'>groups.google.com</a></p>
<a name='There's no undef!'></a><h2>There's no undef!</h2>
<p>Michal Wallace discovered that there seems to be no op to remove a
variable from a lexical pad. Leo patched the scratchpad PMC so that
you can now do:</p>
<pre>    peek_pad Pn
    delete Pn[&quot;foo&quot;]</pre>
<p>to delete variable names.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308160840390.15288-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='Pirate 0.01 ALPHA!'></a><h2>Pirate 0.01 ALPHA!</h2>
<p>Michal Wallace announced the version 0.01 alpha of Pirate which he
described as &quot;(almost) everything I can do for Python without jumping
into C&quot;. Which turns out to be an awful lot of stuff.</p>
<p>I've just looked back through my summary archive and, as near as I
can tell, Michal's gone from thinking about doing this to having most
of the Python syntax working in just under 3 weeks, which is really
rather scary when you think about it. Well done Michal.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308162107030.11614-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<p><a href='http://pirate.tangentcode.com' target='_blank'>pirate.tangentcode.com</a></p>
<a name='Timely destruction: An efficient, complete solution'></a><h2>Timely destruction: An efficient, complete solution</h2>
<p>Right at the end of the week, Luke Palmer posted another attempt to
come up with a neat solution to the timely destruction problem. I'm
guessing we'll see it discussed in next week's summary.</p>
<p><a href='http://groups.google.com/groups?threadm=20030817114814.GA5132@babylonia.flatirons.org' target='_blank'>groups.google.com</a></p>
<a name='POW (Parrot on Win32) available'></a><h2>POW (Parrot on Win32) available</h2>
<p>A while ago now, Jonathan Worthington offered to start making regular
binary builds of Parrot for those who use Win32 but who can't compile
Parrot on it. This week he announced that he's done it. Thanks
Jonathan.</p>
<p><a href='http://groups.google.com/groups?threadm=00cc01c364d2$96e8ba10$0100a8c0@server' target='_blank'>groups.google.com</a></p>
<p><a href='http://www.jwcs.net/developers/perl/pow/' target='_blank'>www.jwcs.net</a> -- The POW site</p>
<a name='Implementing Nickle'></a><h2>Implementing Nickle</h2>
<p>Simon Cozens pointed the list at the nickle programming language and
wondered if it might be a suitable language to implement on Parrot.</p>
<p><a href='http://groups.google.com/groups?threadm=87zni8ouxv.fsf@alibi.simon-cozens.org' target='_blank'>groups.google.com</a></p>
<p><a href='http://nickle.org/implement/html' target='_blank'>nickle.org</a> -- The Nickle site</p>
<a name='Meanwhile, in perl6-language'></a><h1>Meanwhile, in perl6-language</h1>
<p>Traffic was light. Very light.</p>
<a name='Apocalypses and Exegeses'></a><h2>Apocalypses and Exegeses</h2>
<p>Alberto Manuel Brand&atilde;o Sim&otilde;es, noting that the
Apocalypses and Exegeses were subject to later modification, wondered
if anyone had any idea when we'd have a freeze on the syntax and
features for Perl 6. The obvious joke -- &quot;Sometime after Perl 5's
syntax and features freeze&quot; -- was cracked. The consensus was that
the syntax is currently 'slushy', and will probably firm up in the
next 6-12 months. There was also some discussion of <i>Perl 6
Essentials</i>, and Nicholas Clark pointed us all at a new book that
Alan Burlison had found.</p>
<p><a href='http://groups.google.com/groups?threadm=1060861962.24696.21.camel@eremita.di.uminho.pt' target='_blank'>groups.google.com</a></p>
<p><a href='http://bleaklow.com/blog/archive/000018.html' target='_blank'>bleaklow.com</a></p>
<a name='Acknowledgements, Announcements and Apologies'></a><h1>Acknowledgements, Announcements and Apologies</h1>
<p>If anyone's following the 'moving to the North East' saga, last
week's offer fell through, but that was actually a good thing as
we're now buying my daughter's Tyneside flat instead, which does
rather take some of the 'got to get everything sold by mid September'
pressure off and replaces it with 'How on earth are we going to fit
the contents of a 4 bedroomed house into a two bedroomed flat?'
pressure.</p>
<p>In case you hadn't already spotted that I was impressed, much kudos
goes to Michal Wallace for his sterling work on Pirate. Three weeks
from concept to having a huge chunk of the language implemented is
just amazing.</p>
<p>Check out <a href='http://www.bofh.org.uk/' target='_blank'>www.bofh.org.uk</a> for more of my
writing.</p>
<p>As ever, if you've appreciated this summary, please consider one or
more of the following options:</p>
<ul>
<li><a name='Send money to the Perl Foundation at donate.perl-foundation.org/ and help support the ongoing development of Perl.'></a>Send money to the Perl Foundation at
<a href='http://donate.perl-foundation.org/' target='_blank'>donate.perl-foundation.org</a> and help support the ongoing
development of Perl.</li>
<li><a name='Get involved in the Perl 6 process. The mailing lists are open to all. dev.perl.org/perl6/ and www.parrotcode.org/ are good starting points with links to the appropriate mailing lists.'></a>Get involved in the Perl 6 process. The mailing lists are open  to
all. <a href='http://dev.perl.org/perl6/' target='_blank'>dev.perl.org</a> and <a href='http://www.parrotcode.org/' target='_blank'>www.parrotcode.org</a>
are good starting points with links to the appropriate mailing lists.</li>
<li><a name='Send feedback, flames, money, requests for consultancy, photographic and writing commissions, or some free time to p<a href='mailto:6summarizer@bofh.org.uk'>6summarizer@bofh.org.uk</a>'></a>Send feedback, flames, money, requests for consultancy, photographic
and writing commissions, or some free time to
<i><a href='http://search.cpan.org/perldoc?<a href='mailto:p6summarizer@bofh.org.uk'>p6summarizer@bofh.org.uk</a>'>p<a href='mailto:6summarizer@bofh.org.uk'>6summarizer@bofh.org.uk</a></a></i></li>
</ul>
</div>
